#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define i128 __int128
#define mem(x) memset(x,0,sizeof(x))
#define endl "\n"
#define printYes cout << "Yes\n"
#define printYES cout << "YES\n"
#define printNo cout << "No\n"
#define printNO cout << "NO\n"
#define lowbit(x) ((x)&(-(x)))
#define pb push_back
#define mkp make_pair
#define pii pair<int,int>
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define rep(i,j,k) for (int i=(j);i<=(k);i++)
#define per(i,j,k) for (int i=(j);i>=(k);i--)
#define pcnt(x) __builtin_popcount(x)
mt19937 rnd(time(0));
template<class T>void chkmin(T&x,T y){x=min(x,y);}
template<class T>void chkmax(T&x,T y){x=max(x,y);}

const int N=4e5+5;
int a[N],b[N],c[N],d[N];
namespace SGT
{
	int n;
	struct line
	{
		int x,l,r,add;
	}b[N];
	int a[N];
	ll sum[N*4],len[N*4];
	bool cmp(line x,line y)
	{
		return x.x<y.x;
	}
	inline void push_up(int u,int l,int r)
	{
		if (sum[u]>0) len[u]=a[r+1]-a[l];
		else if (l==r) len[u]=0;
		else len[u]=len[u*2]+len[u*2+1];
	}
	void build(int u,int l,int r)
	{
		sum[u]=0,len[u]=0;
		if (l==r) return;
		int mid=(l+r)>>1;
		build(u*2,l,mid),build(u*2+1,mid+1,r);
		push_up(u,l,r);
	}
	void change(int u,int L,int R,int l,int r,int x)
	{
		if (a[R+1]<=l||r<=a[L]) return;
		if (l<=a[L]&&a[R+1]<=r) 
		{
			sum[u]+=x;
			push_up(u,L,R);
			return;
		}
		int mid=(L+R)>>1;
		change(u*2,L,mid,l,r,x);
		change(u*2+1,mid+1,R,l,r,x);
		push_up(u,L,R);
	}	
	ll work(int l,int r)
	{
		n=r-l+1;
		for (int i=1;i<=n;i++)
		{
			int x1=::a[l+i-1],y1=::b[l+i-1],x2=::c[l+i-1],y2=::d[l+i-1];
			a[i*2-1]=x1,a[i*2]=x2;
			b[i*2-1]=(line){y1,x1,x2,1};
			b[i*2]=(line){y2,x1,x2,-1};
		}
		n*=2;
		sort(b+1,b+n+1,cmp);
		sort(a+1,a+n+1);
		int tot=unique(a+1,a+n+1)-a-1;
		tot--;
		build(1,1,tot);
		ll ans=0;
		for (int i=1;i<n;i++)
		{
			change(1,1,tot,b[i].l,b[i].r,b[i].add);
			ans+=len[1]*(1ll*(b[i+1].x-b[i].x));
		}
		return ans;
	}
}
int n,q;

int main()
{
	freopen("dierti.in","r",stdin);
	freopen("dierti.out","w",stdout);
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int tp;
	cin >> tp;
	cin >> n >> q;
	rep(i,1,n) cin >> a[i] >> b[i] >> c[i] >> d[i];
	rep(i,1,q)
	{
		int l,r;
		cin >> l >> r;
		cout << SGT::work(l,r) << "\n";
	}
	return 0;
}
